﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace CoolCode
{
	public abstract class BaseLogger
	{
		public abstract void Write(string msg);

		public virtual void Log(string remark)
		{
			var track = new StackTrace();
			var frame = track.GetFrame(1);
			string error = string.Format("发生错误在方法：{0}, 行号：{1} , 文件：{2}",
				frame.GetMethod().Name,
				frame.GetFileLineNumber(),
				frame.GetFileName());
			Write(error);
			Write("Remark: " + remark);
		}
	}

}
